{layout name="admin:layout" /}
<form id="form" action="{:url('system/admin.miniapp/edit')}">
    <input type="hidden" name="id" value="{$info.id}" />
    <div class="tabs">
        <ul class="tab_menu">
            <li class="current">基本信息</li>
            <li>详情介绍</li>
        </ul>
        <div class="tab_box">
            <div class="box1">
                <table class="formtable">
                    <tr><th>应用名称:</th><td><input datatype="*" class="input w400" type="text" name="title" value="{$info.title}" /></td></tr>
                    <tr><th>目录名:</th><td><input datatype="s" class="input w400" type="text" name="miniapp_dir"  value="{$info.miniapp_dir}"/></td></tr>
                    <tr>
                        <th>应用类型:</th>
                        <td>
                            <select datatype="*" name="types" class="select w400">
                                <option value="mp" {if $info.types=='mp' } selected="selected" {/if}>公众号</option>
                                <option value="program" {if $info.types=='program' } selected="selected" {/if}>小程序</option>
                                <option value="app" {if $info.types=='app'} selected="selected" {/if}>轻应用</option>
                                <option value="mp_program" {if $info.types=='mp_program' }selected="selected" {/if}>小程序/公众号</option>
                                <option value="mp_program_app" {if $info.types=='mp_program_app'} selected="selected" {/if}>小程序/公众号/轻应用</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>接入方式:</th>
                        <td class="input-group">
                            <select datatype="*" name="is_openapp" class="select w200">
                                <option value="0" {if $info.is_openapp==0} selected="selected" {/if}>扫码授权</option>
                                <option value="1" {if $info.is_openapp==1} selected="selected" {/if}>独立配置</option>
                            </select>
                            <select datatype="*" name="is_diyapp" class="select w200">
                                <option value="0" {if $info.is_diyapp==0} selected="selected" {/if}>公共应用</option>
                                <option value="1" {if $info.is_diyapp==1} selected="selected" {/if}>专属定制</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>管理中心:</th>
                        <td>
                            <select datatype="*" name="is_manage" class="select w400">
                                <option value="0" {if $info.is_manage==0} selected="selected" {/if}>关闭</option>
                                <option value="1" {if $info.is_manage==1} selected="selected" {/if}>启用</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><span class="red">*</span> 微信开发平台:</th>
                        <td>
                            <label>版本：</label><input datatype="*" class="input w150" type="text" name="version" value="{$info.version}"/>
                            <label>模板ID：</label><input placeholder="TemplateID" class="input w130" datatype="npot" type="text" name="template_id" value="{$info.template_id}" />
                        </td>
                    </tr>
                    <tr>
                        <th>支付方式:</th>
                        <td>
                            <label>微信支付：</label><select datatype="*" name="is_wechat_pay" class="select w120">
                                <option value="0" {if $info.is_wechat_pay==0} selected="selected" {/if}>禁用 </option>
                                <option value="1" {if $info.is_wechat_pay==1} selected="selected" {/if}>启用 </option>
                            </select>
                            <label>支付宝：</label><select datatype="*" name="is_alipay_pay" class="select w130">
                                <option value="0" {if $info.is_alipay_pay==0} selected="selected" {/if}>禁用 </option>
                                <option value="1" {if $info.is_alipay_pay==1} selected="selected" {/if}>启用 </option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><span class="red">*</span> 开通价格(￥):</th>
                        <td>
                            <label>销售价格：</label><input placeholder="销售价(￥)" class="input w120" datatype="npot" type="text" name="sell_price" value="{$info.sell_price}"/>
                            <label>市场价：</label><input placeholder="市场价(￥)" class="input w130" datatype="npot" type="text" name="market_price" value="{$info.market_price}"/>                       
                        </td>
                    </tr>
                    <tr>
                        <th>体验天数:</th>
                        <td><input datatype="n" class="input w400" type="text" name="expire_day" value="{$info.expire_day}"  /></td>
                    </tr>
                    <tr>
                        <th>描述内容:</th><td><textarea datatype="*" datatype="*" name="describe" class="textarea w400 h60">{$info.describe}</textarea></td>
                    </tr>
                    </tr>
                    <tr class="imgs">
                        <th>应用预览<input  type="hidden" name="view_pic" id="img_index" value="{$info.view_pic}" /></th>
                        <td id="imgbox">
                        <div class="box-view fn-left fn-cp win selectimg" url="{:url('system/admin.common/upload',['close' => 1])}"></div>
                        {foreach $info.style_pic as $pic}<div class="box-view fn-left{if $info.view_pic == $pic} current{/if}">
                        <input type="hidden" name="imgs[]" value="{$pic}" /><img src="{$pic}" onclick="selectImg(this)">
                        <div class="opera">
                            <a class="imgbox-left" href="javascript:;"><i class="iconfont icon-arrowleft"></i></a>
                            <a class="imgbox-right" href="javascript:;"><i class="iconfont icon-arrowright"></i></a>
                            <a class="imgbox-link" href="javascript:;" onclick="linkImg(this)"><i class="iconfont icon-search_icon"></i></a>
                            <a class="imgbox-close" href="javascript:;" onclick="delImg(this)"><i class="iconfont icon-close_icon"></i></a>
                        </div>
                        </div>{/foreach}</td>
                    </tr>
                    <tr>
                        <th>演示码:<input type="hidden" name="qrcode" id="qrcode" value="{$info.qrcode}" /></th>
                        <td>
                        <div url="{:url('system/admin.common/upload')}" class="box-view fn-cp win selectimg" data="qrcode" id="review">
                            {if $info.qrcode}<img src="{$info.qrcode}">{/if}
                        </div>
                    </td>
                </table>
            </div>
            <div class="box2 hide">
                <textarea class="textarea ui-editor" id="content" name="content">{$info.content|dehtml}</textarea>
            </div>
        </div>
    </div>
    <table class="formtable">
        <tr>
            <th></th>
            <td>
                <input type="submit" value="确定" class="button button-blue submit" />
                <input type="reset" value="重置" class="button button-blank" />
            </td>
        </tr>
    </table>
</form>
</div>
<script type="text/javascript">
Do('base', 'layer', 'form', 'tab', 'editor', function () {
    $('#form').isForm({'upload':'{:url("system/admin.common/upload")}'});
    $('.tabs').Tabs({ event: 'click' });
    $(".win").win();
});
//添加图片
function qrcode(value){
    $("#qrcode").val(value);
    $("#review").html('<img src="' + value + '">')
}
</script>